﻿Asm6# Version 0.1
	Ported to C# by snarfblam
ASM6  Version 1.51
	ASM6 written by loopy
	
	
	
Why?
----
	Asm6 was converted to C# to run the assembler in-process in .NET applicaitons. There are other approaches that would allow a .NET application to invoke the assembler: as an external application, compile the assembler to an unmanaged DLL, or compile the assembler to a mixed-mode .NET DLL. Converting the code to C#, however, makes it easy to integrate the assembler to any desired extent within another applicaiton. For example, it would be simple to direct the assembler's output to memory instead of a file, or to get assembler errors without parsing console output, or retrieve or supply the names and values of labels.


What Asm6# is not
-----------------
	Asm6# is not an attempt to improve upon ASM6. The goal is to produce C# code that is semantically identical to the original C code, to exactly reproduce the behavior of the original program. Asm6# can then be used as a starting point to integrate ASM6 into another project.

	
Differences between ASM6 and Asm6#
----------------------------------
	Differences between the two programs that are not listed here, or undocumented bugs (both those that are unique to Asm6# and those common to both versions of the assembler) can be reported to snarfblam@gmail.com.
	There were a number of complexities that arose in converting the code. ASM6 is very pointer-heavy, where C# is a largely pointer-less language. Many of the standard C library functions also had to be re-implemented in C#. It's possible that some bugs may have been introduced in the conversion process.
	Asm6# also uses Unicode encoding, where ASM6 presumably uses ANSI encoding. This gives Asm6# the benefit of not blowing up when reading files that contain a byte-order-marker or are encoded with UTF-16, but Asm6# may fail if the source file includes special characters such as letters with accent marks or various non-American currency symbols.
	Asm6# runs more slowly than ASM6. There are a couple of contributing factors. First, C# runs in a "managed environment" (virtual machine), which performs various saftey checks as the program runs. These saftey checks reduce performance. The other factor is the goal of keeping the semantics of the code the same. While parts of the program could have been re-written with C#'s strengths and weaknesses in mind, the choice was made to leave them as similar to the original code as possible, even when a C# implementation of a C feature results in degraded performance.
	
	
Possible Improvements
---------------------
One improvement I would like to make is a simple mechanism to redirect output that currently goes to the standard output stream (via the console class). If you have a suggestion, feel free to email me.


Legal
-----
	This program includes an implementation of the C function sprintf, written in C# by Richard Prinz, found at http://www.codeproject.com/KB/printing/PrintfImplementationinCS.aspx, licensed under The Code Project Open License (CPOL) 1.02, available at http://www.codeproject.com/info/cpol10.aspx. The text of the license is also present in the code file "printf.cs".